import request from '@/utils/request'

// 分类: 获取-文章分类
export const artGetChannelsService = () => {
  return request.get('/my/cate/list')
}

// 分类: 添加文章分类
export const artAddChannelService = (data) => {
  return request.post('/my/cate/add', data) //这里data是传什么给什么
}
// 分类: 编辑文章分类
export const artEditChannelService = (data) =>
  request.put('/my/cate/info', data)

// 分类: 删除文章分类  query
export const artDelChannelService = (id) =>
  request.delete('/my/cate/del', {
    params: { id }
  })

// 文章 :获取-文章详情
export const artGetListService = (params) => {
  return request.get('/my/article/list', {
    params
  })
}

// 文章： 添加文章
export const artPublishService = (data) => {
  request.post('/my/article/add', data)
}

// 文章：获取文章详情 /my/article/info
export const artGetDetailService = (id) =>
  request.get('my/article/info', {
    params: { id }
  })

// 文章删除
export const artDelService = (id) =>
  request.delete('my/article/info', { params: { id } })
